#!/usr/bin/python3
#coding=utf8
import socket #引入模块，socket
import traceback

servicelist=['192.168.199.102','192.168.199.103','192.168.199.104','192.168.199.105','192.168.199.106','192.168.199.107','192.168.199.108']
socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.setdefaulttimeout(0.5)
#哈哈，ip地址要写对，不然卡的要死
for slist in servicelist:
	#print(slist,"我去不date的")，草你大爷，你这是什么狗，kkkk屎,fsdkfjksdjfksdfj
	for port in range(1,65535):
		print(slist+":"+str(port))
		s=socket.socket()
		try:
			s.connect((slist,port))
			ans=s.recv(1024)
			# print(ans)
			# print(slist,port,"\n")
			poem = slist+':'+str(port)
			if poem:
				f=open('connect.txt','a+');
				f.write(poem+"\n")
				f.close()
			print(poem)
			
		# except Exception as e:
		except:
			# print("异常信息 "+str(e))
			# print("\n",traceback.format_exc())
			# fuck you 分支错误：
			pass
